package com.qiang.test01;

import java.io.*;

public class Demo03 {
    public static void main(String[] args) throws IOException {
        //OutputStreamWriter osw = new OutputStreamWriter(
//  new FileOutputStream("myCharStream\\osw.txt"));
        OutputStreamWriter osw = new OutputStreamWriter(
                new FileOutputStream("day15\\osw.txt"), "GBK");
        osw.write("中国");
        osw.close();

//InputStreamReader isr = new InputStreamReader(
//   new FileInputStream("myCharStream\\osw.txt"));
        InputStreamReader isr = new InputStreamReader(
                new FileInputStream("day15\\osw.txt"), "GBK");
        int ch;
        /*int read = isr.read();
        System.out.println(read);*/
        while ((ch = isr.read()) != -1) {
            System.out.println((char) ch);
        }
        isr.close();
    }
}
